01. Localization Steps

Localization Steps

Localization

All self-driving cars go through the same series of steps to safely navigate through the world.
You’ve been working on the first step: localization. Before cars can safely navigate, they first use sensors and other collected data to best estimate where they are in the world.

Kalman Filter

Let’s review the steps that a Kalman filter takes to localize a car.

1. Initial Prediction

First, we start with an initial prediction of our car’s location and a probability distribution that describes our uncertainty about that prediction.

Below is a 1D example, we know that our car is on this one lane road, but we don't know its exact location.

A one lane one and an initial, uniform probability distribution.

A one lane one and an initial, uniform probability distribution.

2. Measurement Update

We then sense the world around the car. This is called the measurement update step, in which we gather more information about the car’s surroundings and refine our location prediction.

Say, we measure that we are about two grid cells in front of the stop sign; our measurement isn't perfect, but we have a much better idea of our car's location.

Measurement update step.

Measurement update step.

3. Prediction (or Time Update)

The next step is moving. Also called the time update or prediction step; we predict where the car will move, based on the knowledge we have about its velocity and current position. And we shift our probability distribution to reflect this movement.

In the next example, we shift our probability distribution to reflect a one cell movement to the right.

Prediction step.

Prediction step.

4. Repeat

Then, finally, we’ve formed a new estimate for the position of the car! The Kalman Filter simply repeats the sense and move (measurement and prediction) steps to localize the car as it’s moving!

Kalman Filter steps.

Kalman Filter steps.

The Takeaway

The beauty of Kalman filters is that they combine somewhat inaccurate sensor measurements with somewhat inaccurate predictions of motion to get a filtered location estimate that is better than any estimates that come from only sensor readings or only knowledge about movement.